package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by Administrator on 2017/8/30.
 */

public class ForumListApi extends BaseApi {
    ForumProductReq req;


    public ForumListApi(String member_id, String key_word, String page_num) {
        req = new ForumProductReq(member_id, key_word,page_num);
    }


    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).ForumList(requestBody);
    }

    private class ForumProductReq {
        private String member_id;
        private String key_word;
        private String page_num;
        public ForumProductReq(String member_id,  String key_word,String page_num) {
            super();
            this.member_id = member_id;
            this.key_word = key_word;
            this.page_num = page_num;
        }
    }
}
